import { ref, watch } from 'vue';

export default function(props, emit) {
  const dialogVisible = ref<boolean>(false);
  watch(() => props.visible, val => {
    dialogVisible.value = val
  })
  const methods = {
    close() {
      emit('update:visible', false)
    }
  }
  return {
    dialogVisible,
    methods
  }
}
